//package com.hnucm.cooklife.ui.fragment;
//
//
//import android.app.Activity;
//import android.content.Context;
//import android.content.Intent;
//import android.os.Environment;
//import android.util.Log;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageButton;
//import android.widget.Toast;
//
//import androidx.annotation.NonNull;
//import androidx.recyclerview.widget.LinearLayoutManager;
//import androidx.recyclerview.widget.RecyclerView;
//
//import com.blankj.utilcode.util.ToastUtils;
//import com.hnucm.cooklife.R;
//import com.hnucm.cooklife.adapter.FollAdapter;
//import com.hnucm.cooklife.base.BaseFragment;
//import com.hnucm.cooklife.bean.db.Foll;
//import com.hnucm.cooklife.contract.foll.Contract;
//import com.hnucm.cooklife.custom.UsageItemDecoration;
//import com.hnucm.cooklife.presenter.home.FollPresenter;
//import com.hnucm.cooklife.ui.activity.BGAPhotoPickerActivity;
//import com.hnucm.cooklife.ui.activity.DishDetailActivity;
//import com.hnucm.cooklife.ui.activity.MomentListActivity;
//import com.hnucm.cooklife.ui.activity.SystemGalleryActivity;
//import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
//import com.scwang.smartrefresh.layout.SmartRefreshLayout;
//import com.scwang.smartrefresh.layout.api.RefreshLayout;
//
//
//import java.io.File;
//import java.util.ArrayList;
//import java.util.List;
//
//import butterknife.BindView;
//import butterknife.OnClick;
//
//import static android.content.ContentValues.TAG;
//
//public class FollFragment extends BaseFragment<Contract.IFollView, FollPresenter> implements Contract.IFollView,
//        com.scwang.smartrefresh.layout.listener.OnRefreshListener,
//        com.scwang.smartrefresh.layout.listener.OnLoadMoreListener{
//
//    private Context mContext;
//    private FollAdapter mFollAdapter;
//    //服了，调试半天，原来没有new List 啊啊啊，但凡我早点百度，呵呵
//    private List<Foll> mFollList = new ArrayList<>();
//
//    @BindView(R.id.foll_recycler)
//    RecyclerView mRecyclerView;
//
//    @BindView(R.id.refresh_layout)
//    SmartRefreshLayout mSmartRefreshLayout;
//
//    @BindView(R.id.layout_error)
//    ViewGroup mLayoutError;
//
//    @Override
//    protected int getContentViewId() {
//        return R.layout.foll_fragment;
//    }
//
//    @Override
//    protected void init() {
//        mContext = getActivity().getApplicationContext();
//        initAdapter();
//        mPresenter.loadFoll();
//        mSmartRefreshLayout.setNestedScrollingEnabled(false);
//        mSmartRefreshLayout.setOnLoadMoreListener(this);
//        mSmartRefreshLayout.setOnRefreshListener(this);
////        Intent intent = new Intent(getActivity(), MomentListActivity.class);
////        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
////        startActivity(intent);
//
//    }
//
//    private void initAdapter() {
//        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext,LinearLayoutManager.VERTICAL,false));
////        mRecyclerView.addItemDecoration(new UsageItemDecoration());
//        mFollAdapter = new FollAdapter(mContext,mFollList);
//        mRecyclerView.setAdapter(mFollAdapter);
//        mFollAdapter.setOnItemClickListener(new FollAdapter.onItemClickListener() {
//            @Override
//            public void onSeleClickListener(View view, int position) {
////                ToastUtils.showShort(position);
////                new QMUIBottomSheet.BottomListSheetBuilder(getActivity())
////                        .addItem(R.drawable.menu_me,"取消关注@" + mFollList.get(position).userName.toString(),"")
////                        .addItem(R.drawable.menu_collect,"隐藏@" + mFollList.get(position).userName,"")
////                        .setAddCancelBtn(true)
////                        .setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() {
////                            @Override
////                            public void onClick(QMUIBottomSheet dialog, View itemView, int position, String tag) {
////                                dialog.dismiss();
////                                ToastUtils.showShort("hhsafi");
////                            }
////                        })
////                        .build().show();
//
//                Intent intent = new Intent(getActivity(), DishDetailActivity.class);
////                intent.putExtra("dishId",1);
//                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//                startActivity(intent);
//
//
////                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
////                intent.setType("image/*");
////                intent.addCategory(Intent.CATEGORY_OPENABLE);
////                startActivity(intent);
//
////                String path1 = Environment.getExternalStorageDirectory() + File.separator + "test1.jpg";
//                String path1 = Environment.getExternalStorageDirectory().toString();///storage/emulated/0
//                Log.d(TAG, "onSeleClickListener: "+path1);
//            }
//        });
//    }
//
//    @Override
//    protected FollPresenter createPresenter() {
//        return new FollPresenter();
//    }
//
//    @Override
//    public void onLoadFoll( List<Foll> follList) {
//        mFollList.clear();
//        mFollList.addAll(follList);
//        mFollAdapter.setFollList(mFollList);
//    }
//
//    @Override
//    public void onRefreshFoll(List<Foll> follList) {
//        mFollList.clear();
//        mFollList.addAll(0,follList);
//        mFollAdapter.setFollList(mFollList);
//    }
//
//    @Override
//    public void onLoading() {
//
//    }
//
//    @Override
//    public void onLoadingFailed() {
//        ToastUtils.showShort("fail");
//    }
//
//    @Override
//    public void onLoadSuccess() {
//
//    }
//
//    @Override
//    public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
//
//    }
//
//    @Override
//    public void onRefresh(@NonNull RefreshLayout refreshLayout) {
//
//    }
//}
